<!--河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
-->
<template>
  <div class='app-container'>
    <el-form ref="form" :rules="rules" label-width="100px" id="mvcfm">
      <div class="form-unit">
        <span class="mvc-title-left"> 待办事项列表 </span>
      </div>
      <div>
      </div> 事项标题 <div class="el-select">
        <el-input v-model="empty" />
      </div> 模块名称 <div class="el-select">
        <el-input v-model="empty" />
      </div> 任务 ID <div class="el-select">
        <el-input v-model="empty" />
      </div> 任务名称 <div class="el-select">
        <el-input v-model="empty" />
      </div> 待办人 ID <div class="el-select">
        <el-input v-model="empty" />
      </div> 待办人名称 <div class="el-select">
        <el-input v-model="empty" />
      </div> 处理人 ID <div class="el-select">
        <el-input v-model="empty" />
      </div> 处理人名称 <div class="el-select">
        <el-input v-model="empty" />
      </div> 通知时间 <div class="el-select">
        <el-input v-model="empty" />
      </div> - <div class="el-select">
        <el-input v-model="empty" />
      </div> 处理时间 <div class="el-select">
        <el-input v-model="empty" />
      </div> - <div class="el-select">
        <el-input v-model="empty" />
      </div>
      <el-button @click="gotoPage(''+vueparams+'')" type='primary' size="mini"><i class='fa fa-search'></i>搜索</el-button>
      <el-button @click="gotoPage(''+vueparams+'')" type='warning' size="mini"><i class='fa fa-refresh'></i>重置</el-button>
      <el-button @click="gotoPage(''+vueparams+'')" type='warning' size="mini"><i class='fa fa-download'></i>导出</el-button>
      <el-table :data="pageList" v-loading="loading" @selection-change="handleSelectionChange">
        <el-table-column label="#" align="center" type='selection'>
        </el-table-column>
        <el-table-column label="主键 ID" prop="id">
        </el-table-column>
        <el-table-column label="事项标题" prop="item_name">
        </el-table-column>
        <el-table-column label="事项内容" prop="item_content">
        </el-table-column>
        <el-table-column label="模块名称" prop="module">
        </el-table-column>
        <el-table-column label="任务 ID" prop="task_id">
        </el-table-column>
        <el-table-column label="任务名称" prop="task_name">
        </el-table-column>
        <el-table-column label="是否查看" prop="is_view">
        </el-table-column>
        <el-table-column label="是否处理" prop="is_handle">
        </el-table-column>
        <el-table-column label="待办人ID" prop="todo_user_id">
        </el-table-column>
        <el-table-column label="待办人名称" prop="todo_user_name">
        </el-table-column>
        <el-table-column label="处理人ID" prop="handle_user_id">
        </el-table-column>
        <el-table-column label="处理人名称" prop="handle_user_name">
        </el-table-column>
        <el-table-column label="通知时间" prop="todo_time">
        </el-table-column>
        <el-table-column label="处理时间" prop="handle_time">
        </el-table-column>
        <el-table-column label="待办任务名称" prop="node_name">
        </el-table-column>
        <el-table-column label="操作" align="center" width='100' type=''>
          <template slot-scope="scope">
            <el-dropdown trigger="click">
              <span class="el-dropdown-link">操作<i class="el-icon-arrow-down el-icon--right"></i></span>
              <el-dropdown-menu slot="dropdown">
                <el-dropdown-item>
                  <el-link @click="gotoPage(''+vueparams+'')">办理</el-link>
                </el-dropdown-item>
              </el-dropdown-menu>
            </el-dropdown>
          </template>
        </el-table-column>
      </el-table>
    </el-form>
  </div>
</template>
<script>
  import request from '@/utils/request'
  export default {
    name: 'todoitem',
    components: {},
    props: ['popparams'],
    data() {
      return {
        vueparams: this.getVUEParams(""),
        loading: true,
        pageList: [],
        pageSize: 10,
        total: null,
        elcheck: [],
        multiple: true,
        rules: {}
      }
    },
    created() {
      this.getPage(1);
    },
    updated() {},
    mounted() {},
    methods: {
      showVerifyDialog(_params) {
        request({
          method: 'post',
          url: '/xcapi/VUEAction/oa/process/TodoItem/showVerifyDialog?' + _params + this.vueparams,
          data: this.postData()
        }).then(data => {
          this.$router.replace("/redirect" + this.$route.fullPath);
          this.msgSuccess(data.msg);
        })
      },
      list(_params) {
        request({
          method: 'post',
          url: '/xcapi/VUEAction/oa/process/TodoItem/list?' + _params + this.vueparams,
          data: this.postData()
        }).then(data => {
          this.$router.replace("/redirect" + this.$route.fullPath);
          this.msgSuccess(data.msg);
        })
      },
      export (_params) {
        request({
          method: 'post',
          url: '/xcapi/VUEAction/oa/process/TodoItem/export?' + _params + this.vueparams,
          data: this.postData()
        }).then(data => {
          this.$router.replace("/redirect" + this.$route.fullPath);
          this.msgSuccess(data.msg);
        })
      },
      add(_params) {
        request({
          method: 'post',
          url: '/xcapi/VUEAction/oa/process/TodoItem/add?' + _params + this.vueparams,
          data: this.postData()
        }).then(data => {
          this.$router.replace("/redirect" + this.$route.fullPath);
          this.msgSuccess(data.msg);
        })
      },
      edit(_params) {
        request({
          method: 'post',
          url: '/xcapi/VUEAction/oa/process/TodoItem/edit?' + _params + this.vueparams,
          data: this.postData()
        }).then(data => {
          this.$router.replace("/redirect" + this.$route.fullPath);
          this.msgSuccess(data.msg);
        })
      },
      remove(_params) {
        request({
          method: 'post',
          url: '/xcapi/VUEAction/oa/process/TodoItem/remove?' + _params + this.vueparams,
          data: this.postData()
        }).then(data => {
          this.$router.replace("/redirect" + this.$route.fullPath);
          this.msgSuccess(data.msg);
        })
      },
      getPage(page) {
        this.loading = true;
        request({
          method: 'get',
          url: '/xcapi/VUEAction/oa/process/TodoItem/list?' + this.vueparams,
          params: {
            pageNo: page
          }
        }).then(data => {
          this.loading = false;
          this.pageList = data.rows;
          this.total = data.total;
        })
      },
      handleSelectionChange(selection) {
        this.elcheck = selection.map(item => item["id"]);
        this.single = selection.length != 1;
        this.multiple = !selection.length;
      },
    },
  }
</script>
